package pancake.function;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper  extends SQLiteOpenHelper{
	public static final String TABLE="account";
	public static final String TYPE="type";
	public static final String NAME="name";
	public static final String PWD="password";
	public DBHelper(Context context, String name, CursorFactory factory, int version)
	{
		super(context,name,factory,version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		 db.execSQL("CREATE TABLE IF NOT EXISTS "   
	                + TABLE + " ("   
	                + TYPE + " VARCHAR," 
	                + NAME + " VARCHAR,"  
	                + PWD + " VARCHAR)"); 
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		 db.execSQL("DROP TABLE IF EXISTS "+TABLE);  
	     onCreate(db);  
	}
}
